﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.CommonTables.FJ.YXZYY
{
    /// <summary>
    /// QianHouJiaoJieCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class QianHouJiaoJieCtrl : CustomCommonTableCtrl
    {
        public QianHouJiaoJieCtrl()
        {
            InitializeComponent();

            this.Loaded += QianHouJiaoJieCtrl_Loaded;
            sskssj.GotFocus += Sskssj_GotFocus;
            ssjssj.GotFocus += Sskssj_GotFocus;
        }

        private void Sskssj_GotFocus(object sender, RoutedEventArgs e)
        {
            CustomTextCtrl custext = sender as CustomTextCtrl;
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;

            cusDatePicker.ShowDialog();

            if (cusDatePicker.Result)
            {
                custext.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM_CN);
            }
        }
        private void QianHouJiaoJieCtrl_Loaded(object sender, RoutedEventArgs e)
        {
            DataManager.Instance.IsNotNeedSaveData = false;
        }
    }
}
